<%@ Page Language="C#" MasterPageFile="MasterPage.master" AutoEventWireup="true" Inherits="_Settings" Title="Settings Page" Codebehind="Settings.aspx.cs" %>
<asp:Content ID="Content1" ContentPlaceHolderID="contentpanel" Runat="Server">
    <br />
    <asp:Label ID="Label1" runat="server" Font-Bold="True" Font-Size="X-Large" Text="Settings"></asp:Label>
    <br />
    <table>
        <tr>
            <td><asp:Label ID="Label5" runat="server" Text="Load settings from file"></asp:Label></td>
            <td><asp:CheckBox ID="UseFile" runat="server" /></td>
        </tr>
        <tr>
            <td><asp:Label ID="Label6" runat="server" Text="Use IEventService for subscriptions"></asp:Label></td>
            <td><asp:CheckBox ID="UseIEvent" runat="server" 
                OnCheckedChanged="CheckBisSubscribe" AutoPostBack="True"/>
            </td>
        </tr>
        <tr id="ShowBisSubscribe" runat="server">
            <td><asp:Label ID="Label2" runat="server" Text="BiSubscribe Path (on Sensor Server)"></asp:Label></td>
            <td>&nbsp;&nbsp;&nbsp;&nbsp;<asp:TextBox ID="PathBisSubscribe" runat="server" Width="320px"></asp:TextBox>
                <asp:RequiredFieldValidator id="RequiredBisSubscribe" 
                    runat="server" ControlToValidate="PathBisSubscribe"
                    ErrorMessage="* BisSubscribe.exe is a required tool for use with this sensor if the IEventService is disabled." 
                    Display="dynamic">*
                </asp:RequiredFieldValidator>
                <asp:CustomValidator id="ExistsBisSubscribe" runat="server"
                    ControlToValidate="PathBisSubscribe"
                    OnServerValidate="PathBisSubscribeValidate"
                    ErrorMessage="* The file BisSubscribe.exe does not exist or is not accessible." Display="dynamic">*
                </asp:CustomValidator>
            </td>
        </tr>
        <tr>
            <td><asp:Label ID="Label7" runat="server" Text="Use local authentication for SQL server login."></asp:Label></td>
            <td><asp:CheckBox ID="UseWindowsSQLLogin" runat="server" 
                OnCheckedChanged="CheckWindowsLogin" AutoPostBack="True"/>
            </td>
        </tr>
        <tr id="ShowWindowsSQLLogin" runat="server">
            <td><asp:Label ID="Label8" runat="server" Text="SQL Login Name"></asp:Label></td>
            <td>&nbsp;&nbsp;&nbsp;&nbsp;<asp:TextBox ID="SQLUsername" runat="server" Width="320px"></asp:TextBox>
                <asp:RequiredFieldValidator id="RequiredSQLUsername" 
                    runat="server" ControlToValidate="SQLUsername"
                    ErrorMessage="* A username is required for SQL login." 
                    Display="dynamic">*
                </asp:RequiredFieldValidator>

            </td>
        </tr>
        <tr id="ShowWindowsSQLPass" runat="server">
            <td><asp:Label ID="Label9" runat="server" Text="SQL Login Password"></asp:Label></td>
            <td>&nbsp;&nbsp;&nbsp;&nbsp;<asp:TextBox ID="SQLPassword" runat="server" Width="320px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td><asp:Label ID="Label3" runat="server" Text="Team Foundation Server Address"></asp:Label></td>
            <td><asp:TextBox ID="PathServer" runat="server" Width="320px"></asp:TextBox>
                <asp:RequiredFieldValidator id="RequiredServer" runat="server" 
                    ControlToValidate="PathServer"
                    ErrorMessage="* A server is required for this server." 
                    Display="dynamic">*
                </asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td><asp:Label ID="Label4" runat="server" Text="Public VSTFS Sensor Address"></asp:Label></td>
            <td><asp:TextBox ID="PathAddress" runat="server" Width="320px"></asp:TextBox>
                <asp:RequiredFieldValidator id="RequiredAddress" runat="server" 
                    ControlToValidate="PathAddress"
                    ErrorMessage="* An sensor Address is required for this server." 
                    Display="dynamic">*
                </asp:RequiredFieldValidator>
                <asp:CustomValidator id="AddressDirectory" runat="server"
                    ControlToValidate="PathAddress"
                    OnServerValidate="PathAddressValidate"
                    ErrorMessage="* The specified address must point to a directory not a file." Display="dynamic">*
                </asp:CustomValidator>
            </td>
        </tr>
        <tr>
            <td></td>
            <td><asp:Button ID="Save" runat="server" Text="Save" OnClick="Save_Click" />&nbsp;<asp:Label 
                    ID="status" runat="server" Text=""></asp:Label>
            </td>
        </tr>
    </table>
    <asp:ValidationSummary id="valSummary" runat="server"
    HeaderText="Errors:"
    ShowSummary="true" DisplayMode="List" />
</asp:Content>